package masterSpringMvc.config;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter{
	@Override
	protected void configure(HttpSecurity http) throws Exception{
		http.formLogin().loginPage("/login")
		.defaultSuccessUrl("/profile")
		.and()
		.logout().logoutSuccessUrl("/login")
		.and()
		.authorizeRequests()
		.antMatchers("/webjars/**","/login").permitAll().anyRequest().authenticated();
	}
}
